﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DangBaiRaoVat.aspx.cs" Inherits="DangBaiRaoVat" MasterPageFile="~/MasterPage/Sub_NoRight.Master"%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
<asp:Content ContentPlaceHolderID="MainContent" id="maincontent" runat="Server">
      
    <div class="newsbox_noleft">
    <div class="newsbox_noleft_header"><h4>ĐĂNG TIN RAO VẶT</h4></div>
    <div class="newsbox_noleft_content">
<center>
    
    <asp:Panel ID="pnlContent" runat="Server">
    
        <table>
           
            <tr>
                <td align="right" style="width: 113px">
                    <asp:Label ID="lblLoaiTinRaoVat" runat="server" Text="Loại Tin Rao Vặt:"></asp:Label>
                </td>

                <td align="right" width="200">
                    
                    <asp:DropDownList ID="ddlLoaiTinRaoVat" runat="server" Height="24px" 
                        Width="160px" AutoPostBack="True" OnSelectedIndexChanged="ddlLoaiTinRaoVat_SelectedIndexChanged">
                    </asp:DropDownList>
                    
                </td>

                <td  align="right" style="width: 124px">
                     <asp:Label ID="lblDanhMucCon0" runat="server" Text="Danh Mục Chính:"></asp:Label>
                </td>

                <td align="right" width="200">
                 <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                   <ContentTemplate>
                     <asp:DropDownList ID="ddlDanhMucChinh" runat="server"
                        
                        AutoPostBack="True" Height="24px" Width="160px" 
                         DataSourceID="SqlDataSource1" DataTextField="TenDanhMucChinh" 
                         DataValueField="MaDanhMucChinh">
                     </asp:DropDownList>
                     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                         ConnectionString="<%$ ConnectionStrings:RAOVATConnectionString %>" 
                         SelectCommand="SELECT [MaDanhMucChinh], [TenDanhMucChinh] FROM [DANH_MUC_CHINH] WHERE ([Deleted] = @Deleted)">
                         <SelectParameters>
                             <asp:Parameter DefaultValue="false" Name="Deleted" Type="Boolean" />
                         </SelectParameters>
                     </asp:SqlDataSource>
                     </ContentTemplate>
                     </asp:UpdatePanel>
                </td>

            </tr>

            <tr>
                <td  align="right" style="width: 113px">
                    <asp:Label ID="lblDanhMucCon" runat="server" Text="Danh Mục Con:"></asp:Label>
                </td>

                <td align="right" width="200">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                   <ContentTemplate>
                    <asp:DropDownList ID="ddlDanhMucCon" runat="server" Height="24px" Width="160px" 
                        DataSourceID="SqlDataSource2" DataTextField="TenDanhMucCon" 
                        DataValueField="TenDanhMucCon">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:RAOVATConnectionString %>" 
                        SelectCommand="SELECT [TenDanhMucCon] FROM [DANH_MUC_CON] WHERE (([Deleted] = @Deleted) AND ([MaDanhMucChinh] = @MaDanhMucChinh))">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="false" Name="Deleted" Type="Boolean" />
                            <asp:ControlParameter ControlID="ddlDanhMucChinh" DefaultValue="0" 
                                Name="MaDanhMucChinh" PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    </ContentTemplate>
                     </asp:UpdatePanel>
                </td>

                <td  align="right" style="width: 124px">
                    <asp:Label ID="lblDiaDiem" runat="server" Text="Địa Điểm: "></asp:Label>
                </td>

                <td align="right" width="200">
                    <asp:DropDownList ID="ddlDiaDiem" runat="server" Height="24px" Width="160px">
                    </asp:DropDownList>
                </td>

            </tr>
            
            <tr>
                <td  align="right" style="width: 113px">
                    <asp:Label ID="lblTenNguoiDung" runat="server" Text="Tên Người Dùng:"></asp:Label>
                </td>

                <td align="right" width="200">
                    <asp:TextBox ID="txtTenNguoiDung" runat="server" ReadOnly="True" 
                    Width="160px" Height="24px"></asp:TextBox>
                </td>

                <td  align="right" style="width: 124px">
                    <asp:Label ID="lblUpload" runat="server" Text="Ảnh Hiển Thị:"></asp:Label>
                </td>

                <td align="right" width="124" colspan="2">
                    <asp:FileUpload ID="MyUpload" runat="server" Height="24px" Width="200px" />
                </td>
            </tr>
                       <tr>
                <td align="right" style="width: 124px"">
                    <asp:Label ID="lblDiaDiem0" runat="server" Text="Tên Tin Rao Vặt:"></asp:Label>
                </td>
                <td colspan="3" align="left" >
                    <asp:TextBox ID="txtTenTinRaoVat" runat="server" Height="24px" Width="400px" 
                        MaxLength="100"></asp:TextBox>
                </td>

            </tr>

            </table>
 
           
            <br />
             <br />
         
                    <cc1:Editor ID="ckDangTinRaoVat" runat="server" Height="300px" 
            Width="650px"/>
                   
<br />
        
            <center>
                
                 <asp:Button ID="btnDangTin" runat="server" Text="Đăng Tin" CssClass="exclusive" 
                    onclick="btnDangTin_Click" ValidationGroup="DangBai" />
                <asp:Button ID="btnDangTinHot" runat="server" CssClass="exclusive" 
                    onclick="btnDangTin_Click" Text="Đăng Tin"  
                    onclientclick="return confirm('Để đăng tin hot, bạn sẽ bị trừ 10 điểm VIP trong tài khoản. Bạn có muốn tiếp tục?')" 
                    Visible="false" ValidationGroup="DangBai"/>
              
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtTenTinRaoVat" ErrorMessage="Vui lòng nhập tên tin nhắn" 
                    ValidationGroup="DangBai"></asp:RequiredFieldValidator>
                
                <br />
                
               
              
                <br />
                <br />
                <div style="color:Red">
                <asp:Label ID="lblThongBao" runat="server" Font-Size="12pt" 
                    Text="Vui lòng đăng nhập để đăng tin" Visible="False"></asp:Label>
                    </div>
                    </center>
                

      
        </asp:Panel>
        
        <asp:Panel ID="pnlThongBao" runat="server">
            <asp:Label ID="Label1" runat="server" Text="Bạn cần phải đăng nhập để đăng tin rao vặt"></asp:Label>
        </asp:Panel>
        
          </center>
    </div>
  </div>  
  
  
</asp:Content>